<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@include file="/common/common.jsp"%>
<%@include file="/common/skins/skin0/component.jsp" %>
<h:css href="/css/style1/style-custom.css"/>
<%--
- Author(s): pengweiling
- Date: 2012-07-22 13:12:04
- Description:
--%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>
      客户留言录入
    </title>
  </head>
  <body>
    <e:datasource name="weguesmessage" type="entity" path="com.hms.OrderMgr.order.WeGuesmessage" />
    <h:form name="data_form" action="com.hms.OrderMgr.MaterialLoan.flow" method="post" onsubmit="return checkForm(this);">
      <h:hidden property="weguesmessage/imsgid" />
      <l:equal property="_eosLastAccessAction" targetValue="update">
        <input type="hidden" name="_eosFlowAction" value="updateSubmit" >
      </l:equal>
      <l:equal property="_eosLastAccessAction" targetValue="insert">
        <input type="hidden" name="_eosFlowAction" value="insertSubmit" >
      </l:equal>
      <h:hiddendata property="criteria" />
      <h:hidden property="page/begin"/>
      <h:hidden property="page/length"/>
      <h:hidden property="page/isCount"/>
      <dataform id= "393ca042-fbe2-49b4-a4cf-d2a25e2331fd">
          <table align="center" border="0" width="100%" class="form_table">
            <h:hidden property="actionName" value="NORMAL"/>    
            <h:hidden property="loan/iloanid"/>             
            <tr>
              <td class="form_label">
                客单编号
              </td>
              <td colspan="1">
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <w:lookup property="loan/igresid"  
                            style="width:256px;" 
                            displayProperty="loan/cgresno"
                            lookupUrl="com.hms.commonPick.WeOrdersVSelect.flow"
                            dialogTitle="选择客单"
                            onReturnFunc="setInfo"
                            allowInput="false"
                            validateAttr="allowNull=false"/><font style="color:red">*</font>
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <h:text property="loan/cgresno" style="width:256px;" readonly="true"/>
                </l:notEqual>                                 
              </td>
            </tr>
            <tr>
              <td class="form_label">
                房号
              </td>
              <td colspan="1">
                <h:hidden property="loan/iroomid"/>
                <h:text property="loan/croomno" style="width:256px;" readonly="true"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                凭证号
              </td>
              <td colspan="1">
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                    <h:text property="loan/cvoucherno" style="width:256px;"/>
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                    <h:text property="loan/cvoucherno" readonly="true"  style="width:256px;" />
                </l:notEqual>                                
              </td>
            </tr>
            <tr>
              <td class="form_label">
                外借物品
              </td>
              <td colspan="1">                                          
                  <l:equal property="_eosLastAccessAction" targetValue="insert">
                  <w:lookup property="loan/imaterialid"  
                            style="width:256px;" 
                            displayProperty="loan/cmaterialcode"
                            lookupUrl="com.hms.commonPick.WeMaterialsSelect.flow"
                            dialogTitle="选择外借物品"
                            allowInput="false"
                            validateAttr="allowNull=false"/><font style="color:red">*</font>                    
                  </l:equal>       
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                   <h:text property="loan/cmaterialcode" style="width:256px;" readonly="true"/>
                </l:notEqual>                                 
              </td>
            </tr>
            <tr>
              <td class="form_label">
                外借日期
              </td>
              <td colspan="1">
                <w:date property="loan/dcreated" style="width:256px;" readOnly="true"/>                  
              </td>
            </tr>
            <tr>
              <td class="form_label">
                外借操作员
              </td>
              <td colspan="1">
                <h:text property="loan/createdname" style="width:256px;" readonly="true" />
              </td>
            </tr>
            <tr>
              <td class="form_label">
                归还日期
              </td>
              <td colspan="1">
                 <w:date property="loan/drestored" readOnly="true"  style="width:256px;"/>
              </td>
            </tr>
            <tr>
              <td class="form_label">
                归还操作员
              </td>
              <td colspan="1">
               <h:text property="loan/restorename" style="width:256px;" readonly="true" />
              </td>
            </tr>
            <tr>
              <td class="form_label">
               状态
              </td>
              <td colspan="1">
                <h:select disabled="true" property="loan/cstate"  style="width:256px;color:blue">
                  <option value="N">未还</option>
                  <option value="F">已还</option>
                  <option value="C">取消</option>  
                  <option value="R">赔偿</option> 
                </h:select>  
              </td>
            </tr>
            <tr class="form_bottom">
              <td colspan="2">
                <l:equal property="_eosLastAccessAction" targetValue="insert">
                   <input type="submit" value="保存" class="button">
                </l:equal>
                
                <l:notEqual property="_eosLastAccessAction" targetValue="insert">
                  <l:equal property="loan/cstate" targetValue="N">
                     <input type="button" value="归还" class="button" onclick="handle('RETURN')">
                     <input type="button" value="赔偿" class="button" onclick="handle('COMPENSATE')">
                     <input type="button" value="取消" class="button"  onclick="handle('CANCEL')">
                  </l:equal>
                </l:notEqual>
                <input type="button" value="返回" onclick="javascript:history.go(-1);" class="button">
              </td>
            </tr>
          </table>
      </dataform>
    </h:form>
    
    <script>
      function handle(opt){
        $name("actionName").value = opt;
        $name("data_form").submit()
      }
      
      function setInfo(args){
         if (args){
            $name("loan/croomno").value = args[3];
            $name("loan/iroomid").value = args[2];
         }else{
            $name("loan/croomno").value = "";
            $name("loan/iroomid").value = "";
         }
         return true;         
      }
    </script>
  </body>
</html>
